<HTML><HEAD><TITLE>include(+FileSpec)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Directives</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>include(+FileSpec)</H1>
Include other files as part of the program source.
<DL>
<DT><EM>FileSpec</EM></DT>
<DD>File name(s) (atom/string or list of atoms/strings)
</DD>
</DL>
<H2>Description</H2>
<P>
     Include the contents of other file(s) as if the contents of those
     file(s) had been inserted in place of the directive. If more than
     one file is specified, they are included in the order in which they
     appear in the list FileSpec. 
</P><P>
     Included files can contain clauses, directives and queries, but should
     not contain module/1,3 directives (they would be interpreted as
     occurring within the including file, and the included module would
     not end at the end of the included file).  The correct way to use
     another module is via the use_module/1 directive.
</P><P>
     The square bracket notation [File] can be used as a synonym
     for include(File) when used as a directive.
</P><P>
     To include files that contain only comment/2 directives, it is
     preferable to use comment(include, File) - the file will then only
     be included (and needed) by the comment processor, not the compiler.
</P><P>
     The rules for expanding the include file names are the same as
     those used in compile/1,2 regarding suffixes and paths.
</P>
<H3>Modes and Determinism</H3><UL>
<LI>include(+) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H2>See Also</H2>
<A HREF="../../kernel/compiler/D-2.html">. / 2</A>, <A HREF="../../kernel/directives/comment-2.html">comment / 2</A>, <A HREF="../../lib/source_processor/index.html">library(source_processor)</A>
</BODY></HTML>
